import VueCookies from 'vue-cookies'
const TokenKey = 'Access-Token'

export function getToken () {
  if (VueCookies.isKey(TokenKey)) {
    return VueCookies.get(TokenKey)
  } else {
    return localStorage.getItem(TokenKey)
  }
}

export function setToken (token) {
  localStorage.setItem(TokenKey, token)
  return VueCookies.set(TokenKey, token)
}

export function removeToken () {
  localStorage.removeItem(TokenKey)
  return VueCookies.remove(TokenKey)
}
